package errors

import "fmt"

type RESTError struct {
	Code    int
	Status  int
	Message string
}

func NewRESTError(status int, code int, msg string) error {
	return &RESTError{code, status, msg}
}

func (e *RESTError) Error() string {
	return fmt.Sprintf("[%d] %d: %s", e.Status, e.Code, e.Message)
}

func (e *RESTError) GetStatus() int {
	return e.Status
}

func (e *RESTError) GetCode() int {
	return e.Code
}

func (e *RESTError) GetMessage() string {
	return e.Message
}
